import graph.graph as gt
import graph.basicproblem as gb

if __name__ == '__main__':
    V = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
    E= {('a', 'b'), ('b', 'c'), ('c', 'd'), ('d', 'e'), ('e', 'a'),\
        ('a', 'f'), ('b', 'g'), ('c', 'h'), ('d', 'i'), ('e', 'j'),\
        ('f', 'h'), ('g', 'i'), ('h', 'j'), ('i', 'f'), ('j', 'g')}
    # gt.drawgraph(E)
    v0 = 'd'
    paths = gb.Hamitonpath(V, E, v0)
    # print(len(paths))

    # k = 0
    f = open('19375332_homework3_t3.txt', 'w')
    for path in paths:
        path = list(path)
            # k = k + 1
            # print(k, path)
        for v in path:
            if v != path[-1]:
                f.write("'" + v + "', ")
            else:
                f.write("'" + v + "'\n")
    f.close